<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>{{title}}</title>
  <meta name="keywords" content="{{keywords}}" />
  <meta name="description" content="{{description}}" />
   <link type="text/css" rel="stylesheet" href="http://fonts.googleapis.com/css?family=Vollkorn" />
  <link type="text/css" rel="stylesheet" href="http://fonts.googleapis.com/css?family=Sancreek" />
  {% if settings.use_favicon %}
   <link rel="icon" href="{{ 'favicon.ico' | asset_url }}" type="image/x-icon" />   
  <link rel="shortcut icon" href="{{ 'favicon.ico' | asset_url }}" type="image/x-icon" /> 
  {% else %}
  <link rel="icon" href="{{ 'favicon_default.ico' | asset_url }}" type="image/x-icon" />   
  <link rel="shortcut icon" href="{{ 'favicon_default.ico' | asset_url }}" type="image/x-icon" />   
  {% endif %}
  <link rel="stylesheet" href="{{ 'style.css' | asset_url }}" type="text/css" media="screen, projection" />
  <link type="text/css" rel="stylesheet" media="all" href="{{ 'jquery.rating.css' | asset_url }}" />  
  {% if template == 'collection' %}
  <link rel="canonical" href="{{account.url}}{{collection.url}}"/>
  {% elsif template == 'product' %}
  <link rel="canonical" href="{{account.url}}{{product.canonical_url}}"/>
  {% endif %}
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  <!--[if lte IE 7]>
  <link rel="stylesheet" href="{{ 'style_ie.css' | asset_url }}" type="text/css" media="screen, projection" />
  <script type="text/javascript" src="{{ 'pie.js' | asset_url }}"></script>
  <![endif]-->
  <!--[if lte IE 8]>
  <style type="text/css">
  #menu ul, #menu .first, #menu .last, .cart, .search .txt, .catalog, .quantity_input, .price-filter .txt, .coupon .txt, #comment_form input.txt, #review_form input.txt, #comment_form textarea, #review_form textarea, .style-block, #add_product_notification  {
behavior: url({{account.url}}{{ 'PIE.htc' | asset_url }});
   zoom: 1;
 }
.style-block {position: relative;}
.txt, .quantity_input {position: relative;}
#menu ul {z-index: 100; position: relative;}
</style>
<![endif]-->
  <script type="text/javascript" src="{{ 'shadowbox/adapter/shadowbox-jquery.js' | global_asset_url }}"></script>
  <script type="text/javascript" src="{{ 'shadowbox/shadowbox.js' | global_asset_url }}"></script>
  <script type="text/javascript" src="{{ 'jquery.cookie.js' | global_asset_url }}"></script> 
  <script type="text/javascript" src="{{ 'shop/common.js' | global_asset_url }}"></script>
  <script type="text/javascript" src="{{ 'jquery.MetaData.js' | asset_url }}"> </script>
  <script type="text/javascript" src="{{ 'jquery.rating.pack.js' | asset_url }}"> </script>
  <script type="text/javascript" src="{{ 'jquery.cycle.all.js' | asset_url }}"></script>
  <script type="text/javascript" src="{{ 'common.js' | asset_url }}"></script>
  {% if settings.use_font_replacement %}
  <script type="text/javascript" src="{{ 'shop/cufon-yui.js' | global_asset_url }}"></script>
  {% capture fancy_font %}shop/fonts/{{settings.fancy_font}}{% endcapture %}
  <script type="text/javascript" src="{{ fancy_font | global_asset_url }}"></script>
  <script type="text/javascript">
    Cufon.replace('h1#logo span', {
      color: '-linear-gradient({{settings.fancy_text_color}}, {{settings.fancy_text_gradient_color}})'
    });
  </script>
  {% endif %}
  <script type="text/javascript">
    var cv_currency_format = "{{money_with_currency_format}}";
  </script>
  <script type="text/javascript">
    Shadowbox.loadSkin('classic', '/javascripts/shadowbox/skin');
    Shadowbox.loadLanguage('{{ language.locale }}', '/javascripts/shadowbox/lang');
    Shadowbox.loadPlayer(['img'], '/javascripts/shadowbox/player');
    window.onload = Shadowbox.init;
       
    jQuery(function() {
      $("a.add_to_compare").live('click',function(e){ 
        e.preventDefault(); 
      });
  
      new InSales.Compare({
        selector: 'a.add_to_compare',
        draw: function(products) {

          var text = '<h2>Сравнение товаров</h2>';
          if (products.length == 0) {
            text += '<i>Пока ни одного товара к сравнению не добавлено.</i>';
            
          } else {
            text += '<ul class="compare-sidebar">';
            $(products).each(function(index,product) {
              text += '<li><a class="comp-info fl" href="/product/?product_id=' + product.id + '">'+product.title+'</a><a href="#" rel="' + product.id + '" class="remove_compare del fr" href="#">×</a></li>';  
            });
            text += '</ul><input type="submit" value="Сравнить" onclick="window.open(\'/compares\'); return false;" name="" class="button fr">';
          }
          $('.compare-wrap').html(text);
          
        }
      });
      
      $('.compare-sidebar li .remove_compare').each(function() {
 $(this).parents('#middle').find('.prod-block a.add_to_compare[rel="'+$(this).attr('rel')+'"]').replaceWith("<p rel="+$(this).attr('rel')+" class='added'>Товар добавлен к сравнению</p>");
        
       
        
      });
      
      $('.compare-sidebar li .remove_compare').live('click',function() {
         $(this).parents('#middle').find('.prod-block p[rel="'+$(this).attr('rel')+'"]').replaceWith('<a href="#" class="add_to_compare" rel="'+$(this).attr('rel')+'">Добавить к сравнению</a> ');
         
      });
            
      new InSales.Cart({
        selector: 'input.buy',
        draw: function(cart) {
          var text = '';
          if (cart.order_lines.length == 0) {
            text += '<span class="numb">0 </span>товар(ов)';
          } else {
            text += '<span class="numb"> ' + cart.items_count + '</span>товар(ов)';
          }
          $('.cart-inner').html(text);
          this.addCallback = function () {
                this.reloadCart(function () {
                  cart.draw();
                  set_preloaders_message('<div id="add_product_notification"><h3>Товар добавлен в корзину</h3><a href="#" class="closeCartMsg fl buy_button order_button">Продолжить покупки</a><a href="/cart_items/{% if language.not_default? %}?lang={{ language.locale }}{% endif %}" class="fr buy_button">Перейти в корзину</a></div>');
                  //window.setTimeout( hide_preloader, 1000);

                });
              }
        }
      });       
      
      /* поиска по сайту или в категории */
      changeSearch();
      $('.search_check').change(function(){
        changeSearch();
      });
      
      function changeSearch() {
        if($('.search_check').is(':checked')) {
          $('form.searchform').attr('action', '{{collection.url}}');
        } else {
          $('form.searchform').attr('action', '{{search_url}}');
        }
      }
      
      $('.closeCartMsg').live('click', function(e){
       e.preventDefault();
        hide_preloader();
      });
    });
  </script>
  <script type="text/javascript">
 $(function(){
   $('.catalog-arrow').click(function(e){
     e.preventDefault();
     $('.catalog .hidden').css('display','inline-block');
     $(this).hide();
   });
   
   $('.prod-descr.init-tooltip').each(function(){
     
     var fullDescr = $(this).attr('title');
     $(this).parents('.prod-block:first').append('<span class="tooltip">' + fullDescr + '</span>');
   });
   
   $('.prod-descr').mouseover(function(){
    $(this).parents('.prod-block:first').find('.tooltip').fadeIn('100');
   });
   
   $('.tooltip').mouseout(function(){
     $(this).parents('.prod-block:first').find('.tooltip').hide();
   });
 });
</script>
{% if template == 'index' %}  
  <script type="text/javascript">     
    $(document).ready(function() {  
    var slides = $('#slider .image').size(); 
      if(slides>1) {  
        var slider_timeout = {{settings.show_main_image_timeout}};  
      var slider_effect = '{{settings.show_main_image_effect}}';   
      $('#slider').cycle({    
        fx: slider_effect,  
        {% if settings.show_main_image_effect == 'wipe' %}    
                       speed: 400,    
                       {% else %}   
                       speed: 900,   
                       {% endif %}  
                       pager:  '#nav'{% if settings.show_main_image_slider %}, 
                       timeout: slider_timeout{% else %},     
                       timeout: 0 {% endif %}     
                       });
    } else {
                      
                      $('#nav').hide();
                      }
                      }); 
  </script>   
  {% endif %}
 
</head>
  <body id="{% if template == 'page' or template == 'blog' or template == 'article' %}{% if block_lists.news.blocks.size != 0 %}right-column{% else %}one-column{% endif %}{% endif %}{% if template == 'index'%}{% unless settings.index_menu %}{{template}}{% endunless %}{% endif %}{% if template == 'index' and settings.index_menu %}index2{%endif%}{% if template == 'product' or template == 'collection' or template == 'compare' or template == 'search' %}{% endif %}{% if template == 'collection' and collection.subcollections.size > 0 %}one-column{% endif %}{% if template == 'cart' %}one-column{% endif %}">
    <div id="wrapper">
      <div class="inner-wrapper">
      <div id="header-bg"></div>
      <div id="header">
        <div class="center-align">
          <div class="wrapper boxtop">
            <div id="navigation">
              <a class="first" href="/">Главная</a>
              <a href="/client_account/login">Личный кабинет</a>
            </div>
          </div>
		<div class="wrapper box2">
          <!--search-->
          <div class="search">
          <form action="{{search_url}}" method="get" class="searchform">     
           {% if language.not_default? %} <input type="hidden" name="lang" value="{{ language.locale }}"> {% endif %}	 
		  <div class="corn"></div>
		   <input type="text" name="q" class="txt" value="{% if search.query == nil %}Поиск{% else %}{{search.query | escape}} {% endif %}" onfocus="if(this.value=='Поиск'){this.value='{{search.query | escape}}';}"   onblur="if(this.value==''){this.value='';}" />
            <input type="image" class="btn" value="" src="{{'search.gif' | asset_url}}"/>
            {% if template == 'collection' and collection.subcollections.size == 0 %}
            <input type="checkbox" class="checkbox search_check" value="" {% if search.performed? and template == 'collection' %}checked="checked"{% endif %} id="search-in-col" /><label for="search-in-col">В текущей категории</label>
            {% endif %}
		  
		 </form>
		</div>   
        <!--end search-->
        <!--logo-->
		<div class="logo">
          {% if settings.use_logo_image %}
          <a href="/{% if language.not_default? %}?lang={{ language.locale }}{% endif %}">
            <img src="{{ settings.logo_image | asset_url }}" alt="{{account.title}}" />
		</a>
          {% else %}
           {% if settings.show_shop_name %}
          <a href="/{% if language.not_default? %}?lang={{ language.locale }}{% endif %}" class="shop-name">{{account.title}} </a>
         
          {% else %}
          {% endif %}
          {% endif %}
        </div>
        <!--end logo-->
        <!--cart-->
        <div class="cart">
          <span class="cart1">корзина:</span>
         <a href="{{cart_url}}" class="cart-inner">
           {% if cart.items_count == 0 %}
            <span class="numb">0 </span>
           {% else %}
           <span class="numb">{{cart.items_count}} </span>
           {% endif %}
            товар(ов)
         </a>
		</div>
        <!--end cart-->
         
        </div>          
	
           <!--menu -->
          <div class="wrapper">
           <div id="menu">
            <div class="first"></div>
            <div class="menu-inner">
              <ul>
	   {% for link in linklists.main-menu.links %}
                <li><a href="{{link.url}}" title="{{link.title}}" class="{% if link.current? %}selected{% endif %}">{{link.title}}</a></li>
                {% endfor %}
              
              </ul>	
            </div>
            <div class="last"></div>
          </div>
          </div>
          <!--end menu-->
          
     
		
		</div>
	</div><!-- #header-->
      {% unless template == 'index' %}
      {% include 'breadcrumbs' %}
      {% endunless %}
    <!--middle-->
	<div id="middle">  
  {{content_for_layout}}

      
	

      {% if template == 'collection' or template == 'product' or template == 'search' or template == 'compare' %}
      
      <table id="contentMainWrapper" width="100%" cellspacing="0" cellpadding="0" border="0">
      <tbody>
        <tr>
          <td id="column-left" style="width:235px;">
            <div style="width:235px;">
              {% include 'categories' %}
            </div>
          </td>
          <td id="column-center" valign="top">
            <div class="column-center-padding">
              <div id="indexDefault" class="centerColumn">
              	<div id="featuredProducts" class="centerBoxWrapper">

                </div>
              <div class="clear"></div>
            </div>
            </td>
        </tr>
      </tbody>
      </table> 
      
		<div class="sidebar" id="sideLeft">  
          {% if template == 'collection' and collection.products.size > 0 %}
          {% include 'filter' %}
          {% endif %}   
          {% if account.enable_comparison? %}
          {% include 'compare_block' %}
          {% endif %}
          {% if template == 'collection' or template == 'product' or template == 'search' or template == 'compare' %}
          {% include 'recently_view' %}
          {% endif %}
          {% for block in block_lists.left.blocks %}
          <div class="banner-block editor-content">
          {{block.content}}
          </div>
          {% endfor %}
		</div><!-- .sidebar#sideLeft -->
      {% endif %}
      
      {% if template == 'page' or template == 'article' or template == 'blog' %}
      {% if block_lists.news.blocks.size != 0 %}
      <div class="sidebar" id="sideRight">
        {% for block in block_lists.news.blocks %}
        <div class="banner-block editor-content">
        {{block.content}}
        </div>
        {% endfor %}
		</div>
      {% endif %}
      {% endif %}

	</div><!-- #middle-->

      <div id="footer" >
		<div class="center-align">
		   <div class="copy">
             @ Copyright {{account.title}} {{ 'now' | date: "%Y" }}
		   </div>
		   <a class="footmail" href="mailto:{{account.mail}}">{{account.mail}}</a>
		   <ul class="foot-menu">
             {% for link in linklists.footer.links %}
             <li><a href="{{link.url}}" title="{{link.title}}" class="{% if link.current? %}active{% endif %}">{{link.title}}</a></li>
             {% endfor %}
          </ul>
		</div>
      </div><!-- #footer -->
      </div>
    </div><!-- #wrapper -->
  </body>
</html>